#!/usr/local/bin/python3
#-*- coding:utf8 -*-
# Author Aaron 
# 2017-04-09 22:29:16
import RPi.GPIO as GPIO
import time

pin = 7 

GPIO.setmode(GPIO.BOARD)
GPIO.setup(pin,GPIO.OUT)

pwm = GPIO.PWM(pin,100)
pwm.start(100)
while True:
    for i in range(0,100,2):
        pwm.ChangeDutyCycle(i)
        time.sleep(0.02)
    for j in range(100,0,-2):
        pwm.ChangeDutyCycle(j)
        time.sleep(0.02)
GPIO.cleanup()

